package com.ruoyi.community.mapper;

import com.ruoyi.community.domain.MessageAnnounce;
import com.ruoyi.community.domain.MessageAnnounceUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 操作公告用户表
 */
public interface MessageAnnounceUserMapper 
{
    public MessageAnnounceUser selectMessageAnnounceUserById(Long id);

    public List<MessageAnnounceUser> selectMessageAnnounceUserList(MessageAnnounceUser messageAnnounceUser);

    public int insertMessageAnnounceUser(MessageAnnounceUser messageAnnounceUser);

    public int updateMessageAnnounceUser(MessageAnnounceUser messageAnnounceUser);

    public int deleteMessageAnnounceUserById(Long id);

    public int deleteMessageAnnounceUserByIds(Long[] ids);

    // 批量插入未读公告
    public int insertAnnounceUserList(@Param("list") List<MessageAnnounceUser> list);

    // 查询未读公告条数
    int getUnreadAnnounceCount(@Param("communityId") int communityId,  @Param("userId") Long userId);

    // 分页查询公告列表
    List<MessageAnnounceUser> selectAnnounceListPage(@Param("communityId") int communityId, @Param("userId") long userId, @Param("start") int start, @Param("end") int end);

    // 更新阅读公告的状态
    int updateStatus(MessageAnnounceUser messageAnnounceUser);
}
